Optimal. Leaf size=261 \[ \frac{i a b e^{i c} (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},-i d (f+g x)^n\right )}{g n}-\frac{i a b e^{-i c} (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},i d (f+g x)^n\right )}{g n}+\frac{b^2 e^{2 i c} 2^{-\frac{1}{n}-2} (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},-2 i d (f+g x)^n\right )}{g n}+\frac{b^2 e^{-2 i c} 2^{-\frac{1}{n}-2} (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},2 i d (f+g x)^n\right )}{g n}+\frac{1}{2} x \left (2 a^2+b^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.149213, antiderivative size = 261, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 4, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {3367, 3366, 2208, 3365} \[ \frac{i a b e^{i c} (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},-i d (f+g x)^n\right )}{g n}-\frac{i a b e^{-i c} (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},i d (f+g x)^n\right )}{g n}+\frac{b^2 e^{2 i c} 2^{-\frac{1}{n}-2} (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},-2 i d (f+g x)^n\right )}{g n}+\frac{b^2 e^{-2 i c} 2^{-\frac{1}{n}-2} (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},2 i d (f+g x)^n\right )}{g n}+\frac{1}{2} x \left (2 a^2+b^2\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3367
Rule 3366
Rule 2208
Rule 3365
Rubi steps
\begin{align*} \int \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx &=\int \left (a^2+\frac{b^2}{2}-\frac{1}{2} b^2 \cos \left (2 c+2 d (f+g x)^n\right )+2 a b \sin \left (c+d (f+g x)^n\right )\right ) \, dx\\ &=\frac{1}{2} \left (2 a^2+b^2\right ) x+(2 a b) \int \sin \left (c+d (f+g x)^n\right ) \, dx-\frac{1}{2} b^2 \int \cos \left (2 c+2 d (f+g x)^n\right ) \, dx\\ &=\frac{1}{2} \left (2 a^2+b^2\right ) x+(i a b) \int e^{-i c-i d (f+g x)^n} \, dx-(i a b) \int e^{i c+i d (f+g x)^n} \, dx-\frac{1}{4} b^2 \int e^{-2 i c-2 i d (f+g x)^n} \, dx-\frac{1}{4} b^2 \int e^{2 i c+2 i d (f+g x)^n} \, dx\\ &=\frac{1}{2} \left (2 a^2+b^2\right ) x+\frac{i a b e^{i c} (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac{1}{n},-i d (f+g x)^n\right )}{g n}-\frac{i a b e^{-i c} (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac{1}{n},i d (f+g x)^n\right )}{g n}+\frac{2^{-2-\frac{1}{n}} b^2 e^{2 i c} (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac{1}{n},-2 i d (f+g x)^n\right )}{g n}+\frac{2^{-2-\frac{1}{n}} b^2 e^{-2 i c} (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac{1}{n},2 i d (f+g x)^n\right )}{g n}\\ \end{align*}
Mathematica [A] time = 1.96856, size = 277, normalized size = 1.06 \[ \frac{4 i a b (\cos (c)+i \sin (c)) (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},-i d (f+g x)^n\right )-4 i a b (\cos (c)-i \sin (c)) (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},i d (f+g x)^n\right )+b^2 (\cos (c)+i \sin (c))^2 (f+g x) \left (\cosh \left (\frac{\log (2)}{n}\right )-\sinh \left (\frac{\log (2)}{n}\right )\right ) \left (-i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},-2 i d (f+g x)^n\right )+b^2 (\cos (c)-i \sin (c))^2 (f+g x) \left (\cosh \left (\frac{\log (2)}{n}\right )-\sinh \left (\frac{\log (2)}{n}\right )\right ) \left (i d (f+g x)^n\right )^{-1/n} \text{Gamma}\left (\frac{1}{n},2 i d (f+g x)^n\right )+4 a^2 g n x+2 b^2 g n x}{4 g n} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.206, size = 0, normalized size = 0. \begin{align*} \int \left ( a+b\sin \left ( c+d \left ( gx+f \right ) ^{n} \right ) \right ) ^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} a^{2} x + \frac{1}{2} \, b^{2} x - \frac{1}{2} \, b^{2} \int \cos \left (2 \,{\left (g x + f\right )}^{n} d + 2 \, c\right )\,{d x} + 2 \, a b \int \sin \left ({\left (g x + f\right )}^{n} d + c\right )\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (-b^{2} \cos \left ({\left (g x + f\right )}^{n} d + c\right )^{2} + 2 \, a b \sin \left ({\left (g x + f\right )}^{n} d + c\right ) + a^{2} + b^{2}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (c + d \left (f + g x\right )^{n} \right )}\right )^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sin \left ({\left (g x + f\right )}^{n} d + c\right ) + a\right )}^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]